//
//  SubjectCollectionViewCell.m
//  Journey
//
//  Created by dllo on 16/5/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SubjectCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@interface SubjectCollectionViewCell ()

@property(nonatomic,retain)UIImageView *myImageView;

@end
@implementation SubjectCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubview];
    }
    return self;
}
-(void)createSubview
{
    self.myImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.myImageView];
    self.myImageView.backgroundColor = [UIColor lightGrayColor];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.myImageView.frame = self.contentView.bounds;
}

-(void)setSubModel:(SubjectModel *)subModel{
    _subModel = subModel;
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:_subModel.photo] placeholderImage:[UIImage imageNamed:@"image1"]];
   // NSLog(@"%@",_subModel.photo);
}
@end
